package pub.wkq.thread;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

/**
 * @author 王开琦
 */
public class CompletableFutureAsync {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        CompletableFuture<Machina> cf = CompletableFuture.completedFuture(new Machina(0))
                .thenApplyAsync(Machina::work)
                .thenApplyAsync(Machina::work)
                .thenApplyAsync(Machina::work)
                .thenApplyAsync(Machina::work)
                ;


        System.out.println("222" );
        Machina machina = cf.get();
        System.out.println("machina： "+machina);
        System.out.println("hahsh" );
    }
}
